package mediatorPattern;

/**
 * 中介者模式：通过星型模式，解耦同事类之间的关系
 */
public class Client {

    public static void main(String[] args) {
        MediatorStructure mediatorStructure = new MediatorStructure();

        HouseOwner houseOwner = new HouseOwner(mediatorStructure, "张三");
        Tenant tenant = new Tenant(mediatorStructure, "李四");

        mediatorStructure.setTenant(tenant);
        mediatorStructure.setHouseOwner(houseOwner);

        houseOwner.constact("你是不是个菜鸡");
        tenant.constact("我不是");
    }
}
